#pragma once

#ifndef EntityTable_h
#define EntityTable_h

#include <vector>
#include <map>
#include "Type.h"

class EntityTable{

private:
	typedef std::map<Type::Index::Line, Type::Entity::Line> LineEntityTableType;
	typedef std::map<Type::Entity::Line, Type::List::Line> LineTableType;

	LineEntityTableType lineEntityTable;
	LineTableType lineTable;

public:
	EntityTable(void);
	~EntityTable(void);
	void clear();

	/// insert entity with the given line, returns status of operation
	bool insertLineEntity(Type::Index::Line, Type::Entity::Line);

	/// get all entities
	const Type::List::LineEntity& getLineEntities();
	/// get entity with the given line
	Type::Entity::Line getLineEntityByLine(Type::Index::Line);

	/// get the list of all lines
	const Type::List::Line& getLines();
	/// get the list of lines associated with the given entity
	const Type::List::Line& getLinesByEntity(Type::Entity::Line);

	/// check if the given line matches with the given line entity
	bool isLineEntity(Type::Index::Line, Type::Entity::Line);
	/// check for exsistence of the given entity
	bool isEntityExistsInLine(Type::Entity::Line);
	/// check for exsistence of the given line
	bool isLineExistsInEntity(Type::Index::Line);
};
#endif
